package wnco.dao;


import wnco.dto.INode;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface INodeDao extends Neo4jRepository<INode, Long> {
    @Query("match (p:INode) where id(p)=$id return p")
    INode getById(Long id);

    @Query("match (p:INode) where p.name=$name return p")
    INode getByName(String name);

    @Query("match (n:INode) where  $name in n.name  return n")
    List<INode> getInName(String name);

}
